<?php
// class that creates a directory structure
class directory_object() {
    public $dir;
    public $dir_name;
    public $dir_path;

    public function __construct($fullpath) {
        $this->get_path($fullpath); // returns the directory name and 
    }

    // for a given directory, build this level's directory ($lDir) up 
    public function build_directory_level($lDir) {
        // create an array for this level
        $contents = array();
        // determine if file or directory
        foreach ($lDir as $item) {
            if (is_file($this->dir_path . "/" . $item)) {
                // this is a file
            }
            else
            {
                // this is a directory
            }
        }

    }

    // function to split the directory name from the path
    public function get_path($dir) {
        $path_array = explode("/", $dir);
        $this->dir_name = $path_array[count($path_array)];
        $this->dir_path = str_replace($this->dir_name, "", $dir);
    }
}
